package tu.j2ee.tasktracker.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;

@RooJavaBean
@RooJpaEntity
public class CustomUser {
	@Column(unique = true)
	@NotNull
    private String username;

	@NotNull
    private String password;

	@NotNull
    private String email;

    private String name;

    private boolean enabled;

    @Enumerated(EnumType.STRING)
    private UserRole role;
    
    @OneToMany(mappedBy = "assignedUser")
    private List<Task> tasks;
    
    @Override
    public String toString() {
		return username;
    }
}
